# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.ToolResults.V1beta3.Model.TestExecutionStep do
  @moduledoc """
  A step that represents running tests. It accepts ant-junit xml files which will be parsed into structured test results by the service. Xml file paths are updated in order to append more files, however they can't be deleted. Users can also add test results manually by using the test_result field.

  ## Attributes

  *   `testIssues` (*type:* `list(GoogleApi.ToolResults.V1beta3.Model.TestIssue.t)`, *default:* `nil`) - Issues observed during the test execution. For example, if the mobile app under test crashed during the test, the error message and the stack trace content can be recorded here to assist debugging. - In response: present if set by create or update - In create/update request: optional
  *   `testSuiteOverviews` (*type:* `list(GoogleApi.ToolResults.V1beta3.Model.TestSuiteOverview.t)`, *default:* `nil`) - List of test suite overview contents. This could be parsed from xUnit XML log by server, or uploaded directly by user. This references should only be called when test suites are fully parsed or uploaded. The maximum allowed number of test suite overviews per step is 1000. - In response: always set - In create request: optional - In update request: never (use publishXunitXmlFiles custom method instead)
  *   `testTiming` (*type:* `GoogleApi.ToolResults.V1beta3.Model.TestTiming.t`, *default:* `nil`) - The timing break down of the test execution. - In response: present if set by create or update - In create/update request: optional
  *   `toolExecution` (*type:* `GoogleApi.ToolResults.V1beta3.Model.ToolExecution.t`, *default:* `nil`) - Represents the execution of the test runner. The exit code of this tool will be used to determine if the test passed. - In response: always set - In create/update request: optional
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :testIssues => list(GoogleApi.ToolResults.V1beta3.Model.TestIssue.t()) | nil,
          :testSuiteOverviews =>
            list(GoogleApi.ToolResults.V1beta3.Model.TestSuiteOverview.t()) | nil,
          :testTiming => GoogleApi.ToolResults.V1beta3.Model.TestTiming.t() | nil,
          :toolExecution => GoogleApi.ToolResults.V1beta3.Model.ToolExecution.t() | nil
        }

  field(:testIssues, as: GoogleApi.ToolResults.V1beta3.Model.TestIssue, type: :list)

  field(:testSuiteOverviews,
    as: GoogleApi.ToolResults.V1beta3.Model.TestSuiteOverview,
    type: :list
  )

  field(:testTiming, as: GoogleApi.ToolResults.V1beta3.Model.TestTiming)
  field(:toolExecution, as: GoogleApi.ToolResults.V1beta3.Model.ToolExecution)
end

defimpl Poison.Decoder, for: GoogleApi.ToolResults.V1beta3.Model.TestExecutionStep do
  def decode(value, options) do
    GoogleApi.ToolResults.V1beta3.Model.TestExecutionStep.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.ToolResults.V1beta3.Model.TestExecutionStep do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
